// 导演
// 控制整个运行流程
// 这是一个单例类

#ifndef ALICE_DIRECTOR_DIRECTOR_H_
#define ALICE_DIRECTOR_DIRECTOR_H_

#include <string>

#include <SDL.h>
#include <SDL_image.h>

#include "texture_manager.h"
#include "test_people.h"
#include "timer.h"
#include "tool.h"
#include "game_map.h"

namespace alice {

constexpr int kWindowWidth = 960;
constexpr int kWindowHeight = 640;
constexpr char kWindowTitle[] = "Window";

class Director {
  public:
    static Director* GetInstance() {
      return instance_ = (instance_ == nullptr ? new Director() : instance_);
    }

    bool Init();
    void Clean();
    void Quit();

    void Events();
    void Update();
    void Render();

    bool IsRunning() { return is_running_; }
    SDL_Window* GetWindow() { return window_; }
    SDL_Renderer* GetRenderer() { return renderer_; }
    GameMap* GetMap() { return level_map_; }

  private:
    Director() {
      window_ = nullptr;
      renderer_ = nullptr;
    }

  private:
    static Director* instance_;
    bool is_running_;
    SDL_Window* window_;
    SDL_Renderer* renderer_;
    SDL_Event event_;
    GameMap* level_map_;
};

}

#endif // ALICE_DIRECTOR_DIRECTOR_H_
